CROSS_COMPILE   = arm-linux-

AS              = $(CROSS_COMPILE)as
LD              = $(CROSS_COMPILE)ld
LINK            = $(CROSS_COMPILE)gcc
CC              = $(CROSS_COMPILE)gcc -c 
CCLD		= $(CROSS_COMPILE)gcc -O2 -o 
CPP             = $(CROSS_COMPILE)gcc 
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump

#VERSION=0.8.21
#CFLAGS =  -D__STANDALONE__ -DVERSION=\"$(VERSION)\"


objs	= $(patsubst %.c,%.o,$(wildcard *.c))
headers = $(wildcard *.h)
targets	= pump 

.PHONY:all,clean,test
all:$(targets)

$(targets):$(objs)
	$(CCLD) $@ $^ -lresolv -Ilibpopt/include  -Llibpopt/lib -lpopt
	$(STRIP) $(targets)

$(objs):$(headers)
	$(CC) -c -o $@ $(patsubst %.o,%.c,$@)	-Ilibpopt/include

clean:
	rm -f *.o
	rm -f $(targets)
	rm -f *.suo
	rm -f *.ncb
	rm -f *.user
	rm -f *.gch

test:
	make
	./$(targets)

